Avoid computing expensive default values when the value is overridden…#624
Merged
ahal merged 1 commit intotaskcluster:mainfrom Jan 9, 2025
Merged
Avoid computing expensive default values when the value is overridden…#624ahal merged 1 commit intotaskcluster:mainfrom
ahal merged 1 commit intotaskcluster:mainfrom
Conversation
jcristau
reviewed
Jan 9, 2025
… anyways The most expensive call at the moment is repo.get_changed_files, which does down the drain if: - another default_fn overrides the value - an explicit override is given when creating the `Parameters` With this change, the default function can return a function as a value, which is not evaluated unless necessary. Fixes taskcluster#616
ahal
approved these changes
Jan 9, 2025
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Jan 18, 2025
…ing. r=taskgraph-reviewers,jcristau Loading the tasks for the toolchain kind doesn't trigger the optimization passes that use files_changed, so we can just override the parameter to avoid the defaults expensively trying to determine what they are. We also change the default parameters in gecko_taskgraph to apply the same change as taskcluster/taskgraph#624. Differential Revision: https://phabricator.services.mozilla.com/D234628
jwidar
pushed a commit
to jwidar/LatencyZeroGithub
that referenced
this pull request
Sep 16, 2025
…ing. r=taskgraph-reviewers,jcristau Loading the tasks for the toolchain kind doesn't trigger the optimization passes that use files_changed, so we can just override the parameter to avoid the defaults expensively trying to determine what they are. We also change the default parameters in gecko_taskgraph to apply the same change as taskcluster/taskgraph#624. Differential Revision: https://phabricator.services.mozilla.com/D234628
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… anyways
The most expensive call at the moment is repo.get_changed_files, which does down the drain if:
ParametersWith this change, the default function can return a function as a value, which is not evaluated unless necessary.
Fixes #616